# Tanım: Sonraki nesil python üst düzey betik dili
# URL: http://www.python.org
# Paketçi: Cihan_Alkan
# Gerekler: sqlite
# Grup: geliştirme

isim=python
surum=3.7.0
devir=1

kaynak=(https://www.python.org/ftp/python/$surum/Python-$surum.tar.xz
        python.png)

derle() {
	cd Python-$surum
	rm -r Modules/expat
	rm -r Modules/_ctypes/{darwin,libffi}*
	CXX="/usr/bin/g++" \
	./configure --prefix=/usr \
                --enable-shared \
                --with-threads \
                --with-system-expat \
                --with-system-ffi \
                --without-ensurepip \
                --enable-loadable-sqlite-extensions
	make
	make DESTDIR=$PKG install

	chmod -v 755 $PKG/usr/lib/libpython3.7m.so
	chmod -v 755 $PKG//usr/lib/libpython3.so

# Install all HTML Docs files with desktop menu integration

    install -v -dm755 $PKG/usr/share/doc/$isim-$surum/html
    cd $SRC
    wget --no-check-certificate -c https://www.python.org/ftp/$isim/doc/$surum/$isim-$surum-docs-html.tar.bz2 
    tar --strip-components=1 \
        --no-same-owner \
        --no-same-permissions \
        -C $PKG/usr/share/doc/$isim-$surum/html \
        -xvf python-$surum-docs-html.tar.bz2

    find $PKG/usr/share/doc/$isim-$surum -type d -exec chmod 0755 {} \;
    find $PKG/usr/share/doc/$isim-$surum -type f -exec chmod 0644 {} \;

    mkdir -p $PKG/usr/share/applications
    echo "[Desktop Entry]
Categories=Development;Documentation
Exec=xdg-open file:///usr/share/doc/$isim-$surum/html/index.html
Icon=$isim
StartupNotify=false
Terminal=false
Type=Application
Name=Python Documentation
Name[tr]=Python Belgeleri" > $PKG/usr/share/applications/$isim.desktop
    install -Dm644 $SRC/$isim.png \
        $PKG/usr/share/icons/hicolor/16x16/apps/$isim.png
}
doc () {
cd $PKG
bsdtar -cf \
bsdtar -cf \
$PKGMK_PACKAGE_DIR/$isim.doc#$surum-any.mps \
usr/share/doc/$isim-$surum \
usr/share/applications/$isim.desktop \
usr/share/icons/hicolor/16x16/apps/$isim.png

rm -r usr/share/{doc,applications/$isim.desktop,icons/hicolor/16x16/apps/$isim.png}
}
  